<?php


class UpdateOrderStatus extends Connection{
	private $conn;

	public function __construct(){
		Connection::init();
		$this->conn = $this->getConnection();
	}


	public function changeStatus($flag,$id) {
		$stmt = $this->conn->prepare("	UPDATE orders
										SET order_status_id =  ?
										WHERE id = ?");

		if ($flag) {
			$stmt->bindValue(1,2,PDO::PARAM_INT);
		} else {
			$stmt->bindValue(1,3,PDO::PARAM_INT);
		}
		$stmt->bindValue(2,(int)$id,PDO::PARAM_INT);
		$stmt->execute();
	}
}

?>